package jym.tan.tmdb.method.get;

import java.net.URL;

import jym.tan.tmdb.TMDB;
import jym.tan.tmdb.bean.wrapper.MovieTranslationWrapper;
import jym.tan.tmdb.constant.TMDBConstants;
import jym.tan.tmdb.method.Base;

/**
 * The Class MovieTranslations. This class is similar to the <b>Movie Translations</b> method described in 
 * <a href="http://help.themoviedb.org/kb/api/movie-translations">Movie Translations</a>.
 * This method is used to retrieve a list of the available translations for a specific movie.
 * @author Tanmoy
 */
public class MovieTranslations extends Base {

	/**
	 * Instantiates a new MovieTranslations.
	 *
	 * @param tmdb 
	 * 		An instance of the {@link TMDB} class
	 */
	public MovieTranslations(TMDB tmdb) {
		super(tmdb, TMDBConstants.MOVIE, TMDBConstants.TRANSLATIONS);
	}

	/**
	 * Gets a {@link MovieTranslationWrapper} object.
	 *
	 * @param movieId 
	 * 		The TMDB id / the IMDB id
	 * @return 
	 * 		The <code>MovieTranslationWrapper</code> object
	 * @throws Exception 
	 * 		If any kind off exception occurred
	 */
	public MovieTranslationWrapper getMovieTranslationWrapper(String movieId) throws Exception {
		URL movieTranslationURL = getUrl(movieId);
		MovieTranslationWrapper movieTranslationWrapper = getJsonObject(movieTranslationURL, MovieTranslationWrapper.class);
		return movieTranslationWrapper;		
	}
}
